package org.csu.onlineedubackend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.csu.onlineedubackend.entity.Log;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;

@Mapper
public interface LogMapper extends BaseMapper<Log> {
    @Delete("DELETE FROM log WHERE created_at < #{cutoff}")
    int deleteLogsBefore(@Param("cutoff") LocalDateTime cutoff);
}